package exception;

/**
 * 这个主要看了一下try...catch...finally中的return执行【注意可变对象和不可变对象在这边的return值】
 *
 * @author wei.yang on 2018/8/5
 */
public class Main {
    public static void main(String[] args) {
        System.out.println(print());
    }

    static Integer print() {
        Integer i = 0;
        try {
            i = i + 2;
            int a = 8 / 0;
            //  throw new Exception();
            return i;
        } catch (Exception e) {
            i = i + 3;
            return i;
        } finally {
            i = i + 5;
            System.out.println(i);
            //  return i;
        }
    }
}
